package week_4.homework;

import week_4.practice.LinkedOrderedList;
import week_4.practice.LinkedUnorderedList;

public class LinkedListTest {
    public static void main(String[] args) {
        //基于链表实现的有序列表
        System.out.println("基于链表实现的有序列表");
        LinkedOrderedList array1 = new LinkedOrderedList<>();
        array1.add("双门洞");
        array1.add("旧故事");
        array1.add("伙伴们");
        array1.add("Please");
        array1.add("answer");
        array1.add("me");
        array1.add("1988");
        System.out.println(array1.isEmpty());
        System.out.println(array1.size());
        System.out.println(array1.first());
        System.out.println(array1.last());
//        System.out.println(array1.remove("1988"));
        System.out.println("---------------------有序列表为------------------------");
        System.out.println(array1.toString());
        System.out.println();
        System.out.println("基于链表实现的无序列表");
        //基于链表实现的无序列表
        LinkedUnorderedList array2 = new LinkedUnorderedList();
        array2.addToRear("请");
        array2.addToRear("回");
        array2.addToRear("答");
        array2.addToFront("1988");
        array2.addToRear("请不要担心");
        array2.addAfter("致你","1988");
        System.out.println(array2.contains("致你"));
        System.out.println(array2.first());
        System.out.println(array2.last());
        System.out.println("--------------------无序列表为-------------------------");
        System.out.println(array2.toString());
    }
}
